import Vue from 'vue'
import Vuex from 'vuex'
import VuexPersistedstate from 'vuex-persistedstate';
import other from './moduls/other/index'
//
const plugins= [
  VuexPersistedstate()
];
Vue.use(Vuex)

const state = {
  token: ''
}
const getters = {
  token: state => state.token
}
const mutations = {
  setToken (state, payload) {
    state.token = payload
  }
}
const actions = {
  setToken(state, payload){
    state.commit('setToken', payload)
  }
}
const modules = {
    other
}

const store = new Vuex.Store({
  state,
  getters,
  mutations, 
  actions, 
  modules, 
  plugins
})
export default store